import { Image } from 'antd';
import UploadImgs from './UploadImgs';

export default {
  render: (text: any, props: any) => {
    const p = props.fieldProps;
    const obj: any = {};
    if (p.width) {
      obj.width = p.width;
    }
    if (p.height) {
      obj.height = p.height;
    }
    return <Image {...obj} src={text} />;
  },
  renderFormItem: (value: any, props: any) => {
    return <UploadImgs {...props.fieldProps} value={value} />;
  },
};
